package com.petShop.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.petShop.mappers.UserMapper;
import com.petShop.models.Userinfo;

@Repository
public class UserDao {
	@Autowired
	private UserMapper userMapper;
	
	public void insertUser(Userinfo userinfo){
		userMapper.insertUser(userinfo);
	}
	
	public Userinfo selectUserById(int userId){
		return userMapper.selectUserById(userId);
	}
	public Userinfo selectUserByName(String username){
		return userMapper.selectUserByName(username);
	}
	
	public void updateUser(Userinfo userinfo){
		userMapper.updateUser(userinfo);
	}
	public void deleteUser(int userId){
		userMapper.deleteUser(userId);
	}
	
	public void updateUserImg(Userinfo userinfo){
		userMapper.updateUserImg(userinfo);
	}
	
}
